import { defineStore } from "pinia";
import { store } from '@/store';
import { ResourceLeagueMenu } from "@/enums/resourceLeague";

interface PagesState {
  resourceLeagueCurrentMenu: ResourceLeagueMenu;
  resourceLeaguePlateSetStep: 1 | 2;
}

export const usePagesStore = defineStore({
  id: 'pages',
  state: (): PagesState => ({
    // 资源联盟-当前选中菜单;
    resourceLeagueCurrentMenu: ResourceLeagueMenu.PRODUCTLIBRARY,
    // 资源联盟-板块配置-当前步骤: 1 | 2
    resourceLeaguePlateSetStep: 1
  }),
  actions: {
    setResourceLeagueCurrentMenu(data: ResourceLeagueMenu) {
      this.resourceLeagueCurrentMenu = data;
    },
    setResourceLeaguePlateSetStep(data: 1 | 2) {
      this.resourceLeaguePlateSetStep = data;
    },
  }
})


// Need to be used outside the setup
export function useLocaleStoreWithOut() {
  return usePagesStore(store);
}
